//
//  ApplicationCollectionViewCell.m
//  XiRan-iOS
//
//  Created by 韩强 on 12/31/19.
//  Copyright © 2019 Wood. All rights reserved.
//
#import "ApplicationCollectionViewCell.h"
@interface ApplicationCollectionViewCell ()
/// 图片
@property(nonatomic, strong) UIImageView *pictureIV;

@end

@implementation ApplicationCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.contentView.backgroundColor = [UIColor whiteColor];
        [self pictureIV];
    }
    return self;
}

- (UIImageView *)pictureIV {
    if (_pictureIV == nil) {
        _pictureIV = [[UIImageView alloc] init];
        _pictureIV.contentMode = UIViewContentModeScaleAspectFit;
        _pictureIV.layer.cornerRadius = 5;
        _pictureIV.layer.masksToBounds = YES;
        [self.contentView addSubview:_pictureIV];
        
        [_pictureIV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.contentView);
            make.left.equalTo(self.contentView);
            make.right.equalTo(self.contentView);
            make.height.equalTo(@120);
        }];
    }
    return _pictureIV;
}

- (void)setImageUrl:(NSString *)imageUrl {
    _imageUrl = imageUrl;
    [self.pictureIV sd_setImageWithURL:[NSURL URLWithString:[imageUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] placeholderImage:[UIImage imageNamed:@"lunbo"]];

}


@end
